Skip to main content

Command: Generate SFC/LD Visualizations

Important

This command is available to you when you have installed the CODESYS POU Visu Generator add-on.

Symbol: _pvg_icon.png

Function: If your application contains POUs (PRG) or function blocks (FB) in the implementation language Sequential Function Chart (SFC) or Ladder (LD2), then matching visualizations are generated.

Call: Project menu

Requirement: The CODESYS POU Visu Generator package is installed.

After executing the command, the generated objects are stored in the POUs view. You can now use these objects as template visualizations and embed them in your own visualizations using a Frame element or a Tabs element.

The newly generated visualization can run parallel to the application separately without a development system. It visualizes the online status of the application and shows the current program step highlighted in color.

Result with Ladder (LD2)

For PROGRAM POUs, the newly generated visualizations are displayed in the POUs view in the format <FB name>_LD_VISU.

For sub-POUs, the newly generated visualizations are displayed in the POUs view under the LD-Visus folder in the format <POU name><sub-POU name>_LD_VISU.

Sub-POUs are function blocks, actions, properties, methods, or transitions.

Result with SFC

For PROGRAM POUs and function blocks, the newly generated visualizations are displayed in the POUs view in the format <POU name>_SFC_FRAME. Example:

PLC_PRG_SFC_FRAME

You can use a frame element to integrate visualizations with the name extension SFC_FRAME. If the visualization was generated from a function block, then the function block instance fb is automatically declared in the interface editor. The indices such as iCurrentIndex are internal and are set automatically.

For sub-POUs, the newly generated visualizations are displayed in the POUs view under the SFC-SubVisus folder in the format <POU name> SFC_VISU<sub-POU name>.

Sub-POUs are function blocks, actions, properties, methods, or transitions. Example:

POU_1_SFC_VISU, POU_1_SFC_VISU_Step0_to_Init

What you still need to do

For SFC/LD function blocks, you need to transfer the corresponding instance.

This is not necessary for SFC/LD programs because the variables are used directly.

Generating a visualization from an SFC POU

Only possible with LD2 objects

You can create only visualizations for POUs in the Ladder (LD2) implementation language. In order to visualize a POU in LD, first convert it to LD2 using the Convert to New Ladder command. After that, you can generate a LD2 visualization from this.

For more information, see:

Generating a visualization from an SFC POU

Important

Set the SFCCurrentStep flag for each SFC object in its properties dialog on the SFC Settings tab. Otherwise compilation errors will occur.

If the SFC code contains macros, then a separate visualization is generated for each macro. This visualization can be selected by clicking it.

Example 542. Example

Generated SFC visualization

_pvg_img_generated_sfc_visu.png


For more information, see: